import { request } from "./request.js";

export function Index() {
    return request({
        method: "POST",
        url: "Api/index"
    })
}

export function GoodsIndex() {
    return request({
        method: "POST",
        url: "Api/goods_index"
    })
}

export function GoodsLists(data) {
    return request({
        method: "POST",
        url: "Api/goods_lists",
        data
    })
}

export function GoodsDetails(data) {
    return request({
        method: "POST",
        url: "Api/goods_details",
        data
    })
}

export function AddCart(data) {
    return request({
        method: "POST",
        url: "Api/add_cart",
        data
    })
}

export function Login(data) {
    return request({
        method: "POST",
        url: "Login/login",
        data
    })
}


export function shopOne(data) {
    return request({
        method: "POST",
        url: "Api/shop_one",
        data
    })
}

export function addOrder(data) {
    return request({
        method: "POST",
        url: "Api/add_order",
        data
    })
}

export function getOrder(data) {
    return request({
        method: "POST",
        url: "Api/get_order",
        data,
    })
}

export function payOrder(data) {
    return request({
        method: "POST",
        url: "Api/pay_order",
        data,
        msg: true
    })
}

export function changeAddr(data) {
    return request({
        method: "POST",
        url: "Api/change_addr",
        data
    })
}

export function getAddr(params) {
    return request({
        method: "GET",
        url: "Api/get_addr",
        params
    })
}

export function cartIndex(params) {
    return request({
        method: "GET",
        url: "Api/cart_index",
        params
    })
}

export function shopMany(data) {
    return request({
        method: "POST",
        url: "Api/shop_many",
        data
    })
}

export function orderList(data) {
    return request({
        method: "GET",
        url: "Api/order_list",
        data
    })
}